﻿@model Website.Models.Product

@{
    ViewBag.Title = "Edit";
}

<h2>Edit</h2>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"> </script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"> </script>

@using (Html.BeginForm("Edit", "Product", FormMethod.Post, new { enctype = "multipart/form-data" }))
{
    @Html.ValidationSummary()
    <fieldset>
        <legend>Product</legend>

        @Html.HiddenFor(model => model.ProductID)
        
        <div class="editor-label">
            @Html.LabelFor(model => model.CategoryID, "Category")
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.CategoryID)
        </div>
        
        <div class="editor-label">
            @Html.LabelFor(model => model.PriceLevelID, "PriceLevel")
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.PriceLevelID)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.ProductCode)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.ProductCode)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Price)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Price)
        </div>


        <div class="editor-label">
            @Html.LabelFor(model => model.MainImage)
        </div>
        <div class="editor-field">
            @Html.HiddenFor(model => model.MainImage)
            @Html.EditorFor(model => model.MainImage, new { ImageFieldName = "MainImage" })
        </div>
        
        <div class="editor-label">
            @Html.LabelFor(model => model.SmallImage)
        </div>
        <div class="editor-field">
            @Html.HiddenFor(model => model.SmallImage)
            @Html.EditorFor(model => model.SmallImage, new { ImageFieldName = "SmallImage" })
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.SubImage1)
        </div>
        <div class="editor-field">
            @Html.HiddenFor(model => model.SubImage1)
            @Html.EditorFor(model => model.SubImage1, new { ImageFieldName = "SubImage1" })
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.SubImage2)
        </div>
        <div class="editor-field">
            @Html.HiddenFor(model => model.SubImage2)
            @Html.EditorFor(model => model.SubImage2, new { ImageFieldName = "SubImage2" })
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.SubImage3)
        </div>
        <div class="editor-field">
        @Html.HiddenFor(model => model.SubImage3)
            @Html.EditorFor(model => model.SubImage3, new { ImageFieldName = "SubImage3" })
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Desc)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Desc)
        </div>

        <p>
            <input type="submit" value="Save" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Back to List", "Index")
</div>